package com.mars.junit.mq;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.mars.component.mq.JmsQueueMessage;
import com.mars.component.mq.JmsTopicMessage;

public class ActiveMQTest2 extends AbstractTest {
	
	@Autowired
	private JmsQueueMessage jmsQueueMessage ;
	
	@Autowired
	private JmsTopicMessage jmsTopicMessage ;
	
	/**
	 * 发送队列消息，字符串
	 */
	@Test
	public void testQueue1() {
		this.jmsQueueMessage.send("HelloWorld");
		//this.jmsQueueMessage.send(new MQEntity(200, "超人", "cr@126.com"));
	}
	
	/**
	 * 发送队列消息，字符串
	 * @throws InterruptedException 
	 */
	@Test
	public void testQueue2() throws InterruptedException {
		this.jmsTopicMessage.publish("HelloWorld");
		//this.jmsQueueMessage.send(new MQEntity(200, "超人", "cr@126.com"));
	}
}
